package com.lee.mq.mqserver.mapper;

import com.lee.mq.mqserver.core.Binding;
import com.lee.mq.mqserver.core.Exchange;
import com.lee.mq.mqserver.core.MSGQueue;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2023-10-20
 * Time: 19:59
 */
@Mapper
public interface MetaMapper {
    // 核心表创建
    /**
     * 创建交换机表
     */
    void createExchangeTable();
    /**
     * 创建对列表
     */
    void createQueueTable();
    /**
     * 创建绑定关系表
     */
    void createBindingTable();

    // 核心表的插入和删除和查询
    int insertExchange(Exchange exchange);
    int deleteExchange(String exchangeName);
    List<Exchange> selectAllExchanges();

    int insertQueue(MSGQueue msgQueue);
    int deleteQueue(String queueName);
    List<MSGQueue> selectAllQueues();

    int insertBinding(Binding binding);
    int deleteBinding(Binding binding);
    List<Binding> selectAllBindings();
}
